package lex.mxbeans.utils;

import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.lang.reflect.Method;

import org.lex.utils.MethodNameFormatter;


public class Temp
{
	public static void main( String[] args )
	{
		RuntimeMXBean b = ManagementFactory.getRuntimeMXBean();
		test( RuntimeMXBean.class, b );
	}

	static void test( Class<?> clz, Object bean )
	{
		for( Method m : clz.getMethods() )
		{
			if( 0 == m.getParameterTypes().length )
				try
				{
					System.out.println( MethodNameFormatter.format( m.getName() ) + ": "
							+ m.invoke( bean, new Object[0] ) );
				}
				catch( Exception e )
				{
					e.printStackTrace();
				}
		}
	}
}
